package org.patterns.behavior.strategy;


public class Client {
    public static void main(String[] args) {
        MovieTicket ticket = new MovieTicket();
        double originalPrice = 60.0;

        ticket.setPrice(originalPrice);
        System.out.println("原始价为：" + originalPrice);
        System.out.println("---------------------------------");

        Discount discount = (Discount) XMLUtil.getBean(); //读取配置文件并反射生成具体折扣对象
        ticket.setDiscount(discount); //注入折扣对象

        double currentPrice = ticket.getPrice();
        System.out.println("折后价为：" + currentPrice);
    }
}
